<template>
    <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="pageSizes"
        :page-size="pageSize"
        :pager-count="pagerCount"
        layout="total, sizes, prev, next, jumper"
        :total="totalCount">
    </el-pagination>
</template>
<script>
export default {
    name:'RsPagination',
    props:{
        pageSize:{
            type:Number,
            default:10
        },
        totalCount:{
            type:Number,
            default:10
        },
        currentPage:{
            type:Number,
            default:1
        },
        pagerCount:{
            type:Number,
            default:5
        },
        pageSizes:{
            type:Array,
            default:function(){
                return [10, 20, 50, 100]
            }
        }
    },
    data(){
        return{
            pageInfo:{}
        }
    },
    methods:{
        handleSizeChange(pageSize){
            this.$emit('change',{
                currentPage:this.currentPage,
                pageSize:pageSize
            })
        },
        handleCurrentChange(currentPage){
            this.$emit('change',{
                currentPage:currentPage,
                pageSize:this.pageSize
            })
        },
    }
}
</script>